{%extends "base.html"%}
{%block mainmenu%}
  <a href="{%url app.views.index%}" class="active">Links</a>
  <a href="{%url app.views.browse%}">Browse</a>
  <a href="{%url app.views.search%}">Search</a>
{%endblock%}
{%block mainmenu2%}
  {%if user%}
    <a href="{%url app.views.new%}">New Link</a>
    &nbsp;&nbsp;&nbsp;
    <a href="{%url app.views.mine%}">My Links</a>
    &nbsp;&nbsp;&nbsp;
    <a href="{%url app.views.all%}">All</a>
  {%else%}
    <a class="novisit" href="{%url app.views.all%}">All Links</a>
    |
    <a class="novisit" href="{{sign_in}}">Sign in</a>
    with your <a href="https://www.google.com/accounts/NewAccount">Google Account</a>
    to create new links
  {%endif%}
{%endblock%}

{%block body%}
  <h2>Link <a href="{%url app.views.show link.key.id%}">
    {{link.key.id}}</a>: {{link.url}}
    <a href="{{link.url}}" target="_blank"><img alt="visit" src="{{media_url}}Icon_External_Link.png" width="16" height="16"></a>
  </h2>

  <table class="link-details" border="0" width="100%">
    <tr valign="top">
      <td class="meta" width="20%">
        {%block link_actions%}
          <div>
            {%if link.edit_allowed%}
              <a class="novisit"
                 href="{%url app.views.edit link.key.id%}">
                Edit Link
              </a>
            {%else%}
              <span class="disabled">Can't Edit</span>
            {%endif%}
            <br/>
          </div>
        {%endblock%}

        <div class="link_details_sidebar">
          <div><b>Created:</b><br/>
            {{link.created|timesince}} ago by 
            <a href="{%url app.views.show_user link.owner%}">{{link.owner}}</a>
          </div>
          <div><b>Modified:</b><br/>
            {{link.modified|timesince}} ago
          </div>
          <div><b>Visibility:</b><br/>
            {%if link.private%}
                Private. Only viewable by owner.
            {%else%}
                Public
            {%endif%}
          </div>
          <div><b>Superdomains:</b><br/>
            {%for superdomain in link.superdomains%}
              <a href="{%url app.views.search%}?domain={{superdomain}}">{{superdomain}}</a><br>
            {%endfor%}
          </div>
        </div>
      </td>

      <td style="padding-left: .8em; padding-right: .8em;" width="80%">
        {%block link_body%}BODY GOES HERE{%endblock%}
      </td>
    </tr>
  </table>
{%endblock%}
